// 封装banner轮播图相关的业务代码  useBanner.js
import { ref, onMounted } from 'vue';
import { getBannerListAPI } from '@/apis/home';

export function useBanner() {
  const bannerList = ref([]);

  const getBannerList = async () => {
    const res = await getBannerListAPI({
      distributionSite: '2',
    });
    console.log(res);
    bannerList.value = res.data.result;
  };

  onMounted(() => getBannerList());

  return {
    bannerList,
  };
}
